import type { PtPageJson } from "@/modules/pt-page/types";

export const p: PtPageJson = {
    // 版本号
    version: 1,

    // 最后编辑时间
    lastEditTime: "2022-11-09 15:00:00",

    // 页面ID
    id: 124,

    // 页面标题
    title: "专题页面1",

    // 项目配置
    performance: {
        // A4纸长宽
        width: 595,
        height: 842
    },

    // 公共数据，全局可用
    // 值为null时表示未设置值，给二次填充时设置
    // 一般值为数字或字符串
    data: {
        /* 动态数据 */

        // 公共数据
        grade: {},
        class: {},

        // 个人数据
        student: {},

        /* 固定数据 */
        base: {
            contents: [
                { name: 'aaa' },
                { name: 'bbb' },
                { name: 'ccc' },
                { name: 'ddd' }
            ],
            message: "张三好",
            heightValue: "174.7",
            student: {
                id: 4269173,
                name: "张三",
            },
            text_1: "11111111",
            image_1: "https://www.dmoe.cc/random.php",
            cover_1: "https://img.tukuppt.com/ad_preview/00/12/08/5db43361e01e6.jpg!/fw/980",
            table_1: [
                {
                    a: "1111",
                    b: "2222",
                    c: "3333"
                },
                {
                    d: "qqqq",
                    e: "wwww",
                    f: "eeee"
                },
                {
                    d: "qqqq",
                    e: "wwww",
                    f: "eeee"
                }
            ],
            title: "彩虹桥的奇迹：猫头鹰、月亮和魔法森林的故事",
            cover: "https://picsum.photos/200",
            // cover: "https://api.gumengya.com/Api/McImg?format=image",
            description: "《彩虹桥的奇迹》是关于主人公小杰和它的朋友们在彩虹桥世界的冒险。小杰因意外来到彩虹桥，遇见了拥有魔法力量的生物。他们共同抗击邪恶，维护彩虹桥的和谐。小杰逐渐明白友情、勇气和爱是力量的来源。最终，他们击败邪恶，恢复了彩虹桥的和平。故事通过小杰的冒险，传递了友情、勇气和爱的价值观。",
            chatu: "https://www.dmoe.cc/random.php",
            video_1: "https://www.w3schools.com/html/movie.mp4",
            video_2: "https://media.w3.org/2010/05/sintel/trailer.mp4",
            videoPoster1: "https://th.bing.com/th/id/R.6c8abdac2e55990a9af032090f039f6e?rik=FXZMjWTPo6WYPA&riu=http%3a%2f%2fimg.aiimg.com%2fuploads%2fallimg%2f150704%2f1-150F4213440.jpg&ehk=E312MkS8ih2Hw%2fitRX%2buHnaH3kiDl5N0Odixm4Mv%2f6A%3d&risl=&pid=ImgRaw&r=0",
            videoPoster2: "https://img.zcool.cn/community/012a7056986e596ac725af23f88f33.jpg@2o.jpg",
            carouselImage: [
                {
                    type: "image",
                    src: "https://fastly.picsum.photos/id/434/200/80.jpg?hmac=srgmTN05q_3Cjgph8Lc_czOl02YVo2POlNSSMZC4QLs",
                },
                {
                    type: "image",
                    src: "https://fastly.picsum.photos/id/164/200/80.jpg?hmac=2z5C8Tv7a1c0usexXvfDTQgj-DCB_XPc5W2LjqJE8WY",
                },
                {
                    type: "image",
                    src: "https://fastly.picsum.photos/id/802/200/80.jpg?hmac=K4xyjNuiCmZTybaypJnH2wJRX8Fhmw-TwrfCWIodzko",
                },
                {
                    type: "image",
                    src: "https://fastly.picsum.photos/id/42/200/80.jpg?hmac=MHqBuO_VCfJLf_Ymp9yCsHxk7k3dzF3QxRzsgylcWt4",
                },
                {
                    type: "image",
                    src: "https://fastly.picsum.photos/id/832/200/80.jpg?hmac=3UAkKICguELh-2wW8E5WPz90E_Z2VJF_IRcMQebh9S0",
                },
            ]
        }
    },

    // 页面列表
    pages: [
        {
            // 页面标题
            title: "页面1",

            // 页面描述信息
            description: "页面1描述信息",

            // 页面组件配置
            components: [
                {
                    name: "background",
                    type: "image",
                    options: {
                        width: "100%",
                        height: "100%"
                    },
                    value: {
                        src: "cover_1",
                    },
                    render: {
                        fit: "cover",
                        fitVertical: "top"
                    }
                },
                {
                    name: 'header',
                    type: 'block',
                    options: {
                        x: 0,
                        y: 30,
                        width: 240,
                        height: 160,
                        positionAlign: 'center'
                    },
                    value: {
                        children: [
                            {
                                name: "containerCover",
                                type: "image",
                                options: {
                                    positionAlign: "center",
                                    y: 20,
                                    width: 60,
                                    height: 60
                                },
                                value: {
                                    src: "cover",
                                },
                                render: {
                                    fit: 'cover',
                                    borderRadius: -1,
                                    borderWidth: 3,
                                    borderColor: '#fff'
                                }
                            },
                            {
                                name: "containerTitle",
                                type: "text",
                                options: {
                                    width: '80%',
                                    height: 40,
                                    y: 100,
                                    positionAlign: 'center'
                                },
                                value: {
                                    text: "title",
                                },
                                render: {
                                    size: 12,
                                    textAlign: 'center',
                                    weight: 700
                                }
                            }
                        ]
                    },
                    render: {
                        background: '#d3826fe8',
                        borderRadius: 10
                    }
                },
                {
                    name: "description",
                    type: "text",
                    options: {
                        positionAlign: "center",
                        y: 220,
                        width: "74%",
                        height: 100
                    },

                    value: {
                        text: "description",
                    },

                    // 组件内容
                    render: {
                        font: "",
                        size: 14,
                        lineHeight: 1.5,
                        color: "",
                        textAlign: "justify",
                    }
                },
                {
                    name: "chatu",
                    type: "carousel",
                    options: {
                        positionAlign: "center",
                        y: 340,
                        width: 300,
                        height: 100
                    },
                    value: {
                        data: "carouselImage"
                    },
                    render: {
                        // fit: "cover",
                        // borderRadius: 6
                    }
                },
                {
                    name: "videoContainer",
                    type: "block",
                    options: {
                        positionAlign: "center",
                        y: 460,
                        width: "74%",
                        height: 120
                    },
                    value: {
                        children: [
                            {
                                name: "component3",
                                type: "video",
                                options: {
                                    positionAlign: "left",
                                    y: 0,
                                    width: "48%",
                                    height: "100%"
                                },
                                value: {
                                    src: "video_1",
                                    poster: "videoPoster1"
                                },
                                render: {}
                            },
                            {
                                name: "component4",
                                type: "video",
                                options: {
                                    positionAlign: "right",
                                    y: 0,
                                    width: "48%",
                                    height: "100%"
                                },
                                value: {
                                    src: "video_2",
                                    poster: "videoPoster2"
                                },
                                render: {}
                            },
                        ]
                    },
                    render: {
                        // background: "#c9f"
                    }
                },
                {
                    name: "dataTable",
                    type: "table",
                    options: {
                        positionAlign: "center",
                        y: 610,
                        width: 300,
                        height: 120
                    },
                    value: {
                        data: "table_1",
                        rows: [
                            ["student.name", "student.id", ":c"],
                            [":d", ":e", ":f"],
                            [":d", ":e", ":f"],
                        ],
                    },
                    render: {
                        columns: ["80", "", "40"],
                        textAlign: "center",
                        border: true,
                        borderColor: "#ed9c4954",
                        background: "#ffffffa8",
                        size: 12
                    }
                }
            ]
        },
        {
            mode: 'loop',
            origin: 'base.contents.*',
            title: '循环页面',
            description: '描述',
            components: [
                {
                    name: 't',
                    type: 'text',
                    options: {
                        x: 100,
                        y: 100,
                        width: 200,
                        height: 200
                    },
                    value: {
                        text: 'name'
                    },
                    render: {
                        size: 36
                    }
                }
            ]
        },
        {
            // 页面标题
            title: "页面2",

            // 页面描述信息
            description: "页面2描述信息",

            condition: "base.score > 95",

            // 页面组件配置
            components: [
                // 组件配置
                {
                    name: "background",
                    type: "image",
                    options: {
                        x: 0,
                        y: 0,
                        width: "100%",
                        height: "100%"
                    },
                    value: {
                        src: "cover_1",
                    },
                    render: {
                        fit: "cover"
                    }
                },
                {
                    name: "block1",
                    type: "block",
                    options: {
                        x: 0,
                        y: 600,
                        width: "100%",
                        height: "100%"
                    },
                    value: {
                        children: [
                            {
                                name: "text1",
                                type: "text",
                                options: {
                                    x: 0,
                                    y: 0,
                                    width: 100,
                                    height: 100
                                },
                                value: {
                                    text: "text_1",
                                },
                                render: {
                                    size: 24,
                                }
                            }
                        ]
                    },
                    render: {}
                },
                {
                    // 组件名称
                    name: "component1",

                    // 组件类型 block | text | image | video | table
                    type: "text",

                    // 组件在页面中的信息
                    options: {
                        // 基于上一层的坐标
                        x: 30,
                        y: 60,
                        width: 100,
                        height: 100
                    },
                    value: {
                        text: "text_1",
                    },
                    render: {
                        font: "",
                        size: 14,
                        lineHeight: 1.5,
                        color: "",
                        textAlign: "right",
                    }
                },
                {
                    // 组件名称
                    name: "component2",

                    // 组件类型 block | text | image | video | table
                    type: "image",

                    // 组件在页面中的信息
                    options: {
                        // 基于上一层的坐标
                        x: 30,
                        y: 200,
                        width: 300,
                        height: 100
                    },
                    value: {
                        src: "image_1",
                    },
                    render: {
                        fit: "cover"
                    }
                },
                {
                    // 组件名称
                    name: "component3",

                    // 组件类型 block | text | image | video | table
                    type: "video",

                    // 组件在页面中的信息
                    options: {
                        // 基于上一层的坐标
                        x: 400,
                        y: 100,
                        width: 200,
                        height: 160
                    },
                    value: {
                        src: "video_1",
                        poster: ""
                    },
                    render: {}
                },
                {
                    // 组件名称
                    name: "component4",

                    // 组件类型 block | text | image | video | table
                    type: "video",

                    // 组件在页面中的信息
                    options: {
                        // 基于上一层的坐标
                        x: 120,
                        y: 500,
                        width: 220,
                        height: 180
                    },
                    value: {
                        src: "video_2",
                        poster: ""
                    },
                    render: {}
                },
                {
                    name: "component5",
                    type: "table",
                    options: {
                        positionAlign: null,
                        positionVertical: null,
                        x: 0,
                        y: 700,
                        width: 300,
                        height: 250
                    },
                    value: {
                        data: "table_1",
                        rows: [
                            ["a", "b", "c"],
                            ["d", "e", "f"],
                            ["d", "e", "f"],
                        ],
                    },
                    render: {
                        columns: ["80", "", "40"],
                        border: true,
                        borderColor: "#6688cc"
                    }
                }
            ]
        },
    ],
};

